﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SwenAssigment.Classes
{
    public class Year
    {
        private int YearNo;
        private List<Day> Days;
        private int TotalRoom;
        public Year(int YearNo, int TotalRoom, List<Day> Days)
        {
            this.YearNo = YearNo;
            this.TotalRoom = TotalRoom;
            this.Days = Days;
        }
        public List<Day> getDays()
        {
            return Days;
        }
        public Decimal GetStatics()
        {
            Decimal Total = 0;
            foreach (Day day in Days)
            {
                Total += day.getORoom();
            }
            try
            {
                Total = (Decimal)(Total / (TotalRoom * Days.Count)) * 100;
            }
            catch (Exception ex)
            {
                Total = 0;
            }

            return Total;
        }
    }
}